package com.ssky.bean.validator.core.rule;

import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

import java.util.List;

public class Field {
    @XStreamAsAttribute
    private String name;

    @XStreamAsAttribute
    private String fbTag;

    @XStreamAsAttribute
    private String className;

    @XStreamAsAttribute
    private String fbValue;

    @XStreamImplicit(itemFieldName = "rule")
    private List<Rule> rules;

    @XStreamImplicit(itemFieldName = "field")
    private List<Field> fields;

    /**
     * 字符描述转换为java引用类型
     */
    private Class<?> classType;


    /**
     * 当前field所属的field
     */
    private Field preField;

    /**
     * 对于整个javabean而言的属性路径
     */
    private String fullName;

    /**
     * 校验bean的类型
     */
    private Class<?> beanClassType;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFbTag() {
        return fbTag;
    }

    public void setFbTag(String fbTag) {
        this.fbTag = fbTag;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getFbValue() {
        return fbValue;
    }

    public void setFbValue(String fbValue) {
        this.fbValue = fbValue;
    }

    public List<Rule> getRules() {
        return rules;
    }

    public void setRules(List<Rule> rules) {
        this.rules = rules;
    }

    public List<Field> getFields() {
        return fields;
    }

    public void setFields(List<Field> fields) {
        this.fields = fields;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public Class<?> getClassType() {
        return classType;
    }

    public void setClassType(Class<?> classType) {
        this.classType = classType;
    }


    public Field getPreField() {
        return preField;
    }

    public void setPreField(Field preField) {
        this.preField = preField;
    }

    public Class<?> getBeanClassType() {
        return beanClassType;
    }

    public void setBeanClassType(Class<?> beanClassType) {
        this.beanClassType = beanClassType;
    }
//    public Class<?> getPreviousFieldClassType() {
//        return previousFieldClassType;
//    }

//    public void setPreviousFieldClassType(Class<?> previousFieldClassType) {
//        this.previousFieldClassType = previousFieldClassType;
//    }
}
